package com.zzw.zim.security.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * Security密码加密配置
 *
 * @author XiaoJie
 * @date 2025/5/15 14:07
 */
@Configuration
public class PasswordConfig {
	@Bean(name = "password")
	public PasswordEncoder passwordEncoder () {
		// return PasswordEncoderFactories.createDelegatingPasswordEncoder();
		return new BCryptPasswordEncoder();
	}

	public static void main (String[] args) {
		System.out.println(new BCryptPasswordEncoder().encode("user123456"));
	}

}
